/**
 * 
 */
package org.arpit.masteringextjs.jsonserializer;

import java.io.IOException;
import java.util.Date;

import org.arpit.masteringextjs.utility.DateTimeUtility;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;

/**
 * @author arpit
 *
 */
public class DateSerializer extends JsonSerializer<Date>{

	@Override
	public void serialize(Date date, JsonGenerator jsonGenerator, SerializerProvider arg2)
			throws IOException, JsonProcessingException {
		jsonGenerator.writeObject(DateTimeUtility.toString(date));
	}

}
